# -*- coding = utf-8 -*-
# @Time : 2023/12/14 17:08
# @Author : 龙王赘婿冷帝彪少
# @File : file_with.py
# @Software : PyCharm

# 对于需要关闭的文件，使用语法糖with
class File:
    def __init__(self):
        with open("../file/io_test2.txt", "w+") as f:
            count: int = 0
            while True:
                count = count + 1
                f.write(f"liu zhi biao is shuaige num {count}\n")


if __name__ == "__main__":
    obj = File()
